package Q3;

import java.util.*;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别

        int n = sc.nextInt();
        int k = sc.nextInt();

        Integer[] arr = new Integer[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }

        //降序排序
        Arrays.sort(arr, Collections.reverseOrder());

        //找到所有的偶数，并计算所有的奇数和
        long sum = 0;
        List<Integer> evenNum = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            if (arr[i] % 2 == 0) {
                evenNum.add(arr[i]);
            } else {
                sum += arr[i];
            }
        }

        while (k > 0 && !evenNum.isEmpty()) {
            k--;
            Integer num = evenNum.remove(0); //找到最大的偶数
            num /= 2;
            if (num % 2 == 0) {
                evenNum.add(num);
                Arrays.sort(arr, Collections.reverseOrder());
            } else {
                sum += num;
            }
        }

        while (!evenNum.isEmpty()) {
            sum += evenNum.remove(0);
        }

        System.out.println(sum);
    }
}
